home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d7
/
exechk.arc
/
ABORT.INC
next >
Wrap
Text File
|
1990-12-06
|
2KB
|
38 lines
(*******************************************************************
Procedure to abort process in case of error; with message.
*******************************************************************)
procedure Abort ( S : string ) ;
begin
writeln ( 'Message : ' , S , #7#7#7 ) ;
Halt ( 1 ) ;
end ;
(*******************************************************************
Convert string to upper case.
*******************************************************************)
function Upper ( S : string ) : string ;
var
temp : string ;
B : byte ;
begin
temp := S ;
for B := 1 to length ( S ) do
temp [ B ] := UpCase ( temp [ B ] ) ;
Upper := temp ;
end ;
(*******************************************************************
Returns a byte for the drive letter, where 1 thru 26 = A: thru Z:
*******************************************************************)
function DriveNum ( S : string ) : byte ;
begin
DriveNum := 0 ;
if pos ( ':' , S ) <> 2 then EXIT ;
DriveNum := ord ( UpCase ( S [ 1 ] ) ) - 64 ;
end ;
(*******************************************************************
Check that this program is an EXE file AND is on drive A:
*******************************************************************)
function IsDriveA ( S : string ) : boolean ;
begin
IsDriveA := DriveNum ( S ) = 1 ;
end ;